﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using CoiffeurProject.Screens;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Windows.Input;
using CoiffeurProject.Utils;
using System.Windows.Media;

namespace CoiffeurProject.UserControls
{
    internal class CustTabControl
    {
        List<TransparentButton> buttons;
        List<Image> images;
        List<Grid> tabs;
        Grid main_container;

        internal CustTabControl(List<ImageRef> tabs, int header_height, int padding, Thickness margin, int row, int column)
        {
            this.buttons = new List<TransparentButton>();
            this.images = new List<Image>();
            this.tabs = new List<Grid>();

            for (int i = 0; i < tabs.Count; i++)
            {
                var button_width = tabs[i].Width / tabs.Count;
                buttons.Add(new TransparentButton(new Thickness(button_width * i,0,0,0), 
                    0, 0, button_width, header_height));
                images.Add(new Image() { Source = new BitmapImage(new Uri(tabs[i].Uri)), Stretch = Stretch.Fill });
            }

            main_container = new Grid()
            {
                Width = tabs.First().Width,
                Height = tabs.First().Height - header_height,
                Margin = margin
            };

            Grid.SetColumn(main_container, column);
            Grid.SetRow(main_container, row);
        }
    }

    internal struct ImageRef
    {
        internal string Uri;
        internal int Width;
        internal int Height;
    }
}
